class AnalyzerUtils {
    static tokenFromAnalysis(analyzer, text) {
        def stream = analyzer.tokenStream("contents", new StringReader(text))
        def tokens = []
        while (true) {
            def token = stream.next()
            if (token) {
                tokens << token
            } else {
                break
            }
        }
        return tokens
    }
}